#!/bin/bash
# copysploit by @xer0dayz
# A small script to automatically find and copy an exploit file to the current directory...
#

EDITOR='gedit' # PREFERED TEXT EDITOR
COLOR1='\033[1m\033[91m'
COLOR2='\033[1m\033[92m'
COLOR3='\033[1m'

function logo {
	echo -e "$COLOR3   ___ _           _           _       _ _   "
	echo -e "$COLOR3  / __(_)_ __   __| |___ _ __ | | ___ (_) |_ "
	echo -e "$COLOR3 / _\ | | '_ \ / _\` / __| '_ \| |/ _ \| | __|"
	echo -e "$COLOR3/ /   | | | | | (_| \__ \ |_) | | (_) | | |_ "
	echo -e "$COLOR3\/    |_|_| |_|\__,_|___/ .__/|_|\___/|_|\__|"
	echo -e "$COLOR3                        |_|                  "
	echo ""
	echo -e "$COLOR1+ -- --=[ findsploit by @xer0dayz"
	echo -e "$COLOR1+ -- --=[ https://xerosecurity.com$RESET"
	echo ""
}

if [ -z "$1" ]; 
then
	logo
	echo ""
	exit;
else
	DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
	logo
	echo -e "$COLOR1+ -- --=[ COPYING:$COLOR2 $1 $COLOR1 TO $COLOR2 `pwd` $RESET"
	echo ""
	find /pentest/exploits/ -name $1 -exec cp -f {} . \;
	echo -e "$COLOR1"
	ls -lahtr $1
fi
exit

